Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support getCompletions in external module name references in imports and exports #2173

Closed
wants to merge 1 commit into from

Conversation

mhegazy
Copy link
Contributor

@mhegazy mhegazy commented Feb 28, 2015

there is still some work that needs to be done on the editor side, but this should cover the service side.

return false;
}

function getExternalModulecompletions(location: Node): CompletionInfo {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalize the 'c'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave a comment about what kinds of completions we support, then leave a small example. For instance, we don't hit the disk to look up available files (and note this in the comment), so be explicit, since I find that modules are the most arcane part of the compiler and language.

@DanielRosenwasser
Copy link
Member

You may want someone who knows more about the internals of modules to take a look. Otherwise, just update the API samples.

@@ -2483,6 +2485,11 @@ module ts {
log("getCompletionsAtPosition: Get previous token 2: " + (new Date().getTime() - start));
}

// Check of this is an external module name completion location
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Check if"

@mhegazy mhegazy closed this Mar 30, 2015
@mhegazy
Copy link
Contributor Author

mhegazy commented Mar 30, 2015

closing for now.

@basarat
Copy link
Contributor

basarat commented Apr 3, 2015

Curious why this was closed?

@mhegazy
Copy link
Contributor Author

mhegazy commented Apr 3, 2015

The problem is that the current API makes it the caller's responsibility to find the replacement span for a completion item, e.g. "a.fo|" with completion item "foo" would result in replacing the "fo"; this is ok if all the replacements are identifiers.

in this case if you are replacing a string applying the same logic does not work. so i need to add a replacement range to the API. i will reactivate it once i am done with a few other items related to modules and decorators. but should be able to get back to it within the next few weeks.

@basarat
Copy link
Contributor

basarat commented Apr 4, 2015

Cool. I was just curious if there were dragons in the code path. The code seems fit for my purpose. I replace the entire import string on users behalf ;)

@mhegazy mhegazy deleted the externalModuleNameCompletions branch November 2, 2017 21:01
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants